from django.conf.urls import url, include
from django.contrib import admin
from django.http import HttpResponse


def not_found(request, exception):
    html = """
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<h3>找不到</h3>
<p>
%s
</p>
</body>
</html>
"""
    html = html % str(exception)
    return HttpResponse(html, status=404)


handler404 = not_found


urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^polls/', include('polls.urls')),
    url(r'^book/', include('book.urls')),
    url(r'^news/', include('news.urls')),
]
